import { useCookies } from "@vueuse/integrations/useCookies";
import { set } from "nprogress";

const cookies=useCookies()
const token="token"

const cookieData={
  //获取token
  getToken:function(){
    return cookies.get(token)
  },

  //设置token
  setToken:(val)=>{
    cookies.remove(token)
    cookies.set(token,val)
  },

  //删除token
  removeToken:function(){
    cookies.remove(token)
    LocalStorage.clearAll()
  },

  //设置自定义数据
  setData:function(name,val){
    cookies.remove(name)
    cookies.set(name,val)
  },
  //获取自定义数据
  getData:function(name){
    return cookies.get(name)
  },

  //删除自定义数据
  removeData:(name)=>{
    cookies.remove(name)
  }

}

export default cookieData;